import type { RouteRecordRaw } from 'vue-router'


export const RouteDefinition: Array<RouteRecordRaw> = [
    {
        path: '/',
        component: () => import('@/page/Layout/LeftRightLayout.vue'),
        redirect: () => ({ path: '/home' }),
        children: [
            {
                path: 'home',
                component: () => import('@/page/Home/HomePage.vue'),
                meta: {
                    title: '天枢星阙',
                    authorized: true,
                },
            },
            {
                path: 'setting',
                component: () => import('@/page/Layout/TabSwitchLayout.vue'),
                meta: {
                    title: '设置',
                    authorized: true,
                    isTabsRoot: true,
                },
                redirect: () => ({ path: '/setting/general' }),
                children: [
                    {
                        path: 'general',
                        component: () => import('@/page/Setting/GeneralSettingPage.vue'),
                        meta: {
                            title: '常规设置',
                            authorized: true,
                        },
                    },
                    {
                        path: 'global-background',
                        component: () => import('@/page/Setting/BackgroundSettingPage.vue'),
                        meta: {
                            title: '全局背景设置',
                            authorized: true,
                        },
                    },
                    {
                        path: 'local-background',
                        component: () => import('@/page/Setting/LocalBackgroundSettingPage.vue'),
                        meta: {
                            title: '本地背景设置',
                            authorized: true,
                        },
                    },
                    {
                        path: 'icons',
                        component: () => import('@/page/Setting/SiteIconSettingPage.vue'),
                        meta: {
                            title: '图标设置',
                            authorized: true,
                        },
                    },
                ],
            },
            {
                path: 'account',
                component: () => import('@/page/User/AccountInfo.vue'),
                meta: {
                    title: '账户信息',
                    authorized: true,
                },
            },
        ],
    },
    {
        path: '/login',
        component: () => import('@/page/Login/LoginPage.vue'),
        meta: {
            title: '登录',
        },
    },
    {
        path: '/:pathMatch(.*)*',
        component: () => import('@/page/Error/ErrorPage.vue'),
        meta: {
            title: '404',
        },
    },
]
